import http from '@/utils/http';
import {postAjax} from '@/utils/axios';

/**
 * 获取区域树
 * @param params
 * @returns {*|Promise<any>}
 */
export const getPrepareTitle = (params?: any) => {
  if(params && params.id){
    return http.get('bus/dataSearch/getPrepareTitle/'+ params.id);
  }
  return http.get('bus/dataSearch/getPrepareTitle');
}

/**
 * 获取区域树
 * @param params
 * @returns {*|Promise<any>}
 */
export const getApprovalTitle = (params?: any) => {
  if(params && params.id){
    return http.get('bus/dataSearch/getApprovalTitle/'+ params.id);
  }
  return http.get('bus/dataSearch/getApprovalTitle');
}
export const getRecycleTitle = (params?: any) => {
  if(params && params.id){
    return http.get('bus/dataSearch/getRecycleTitle/'+ params.id);
  }
  return http.get('bus/dataSearch/getRecycleTitle');
}




/**
 * 获取区域树
 * @param params
 * @returns {*|Promise<any>}
 */
export const getCommonTitle = (params?: any) => {
  if(params && params.id){
    return http.get('bus/dataSearch/getCommonTitle/'+ params.id);
  }else{
    return http.get('bus/dataSearch/getCommonTitle/');
  }
 
}

export const getPrepareList = (params?: any) => {
  return postAjax('bus/dataSearch/prepareList', params);
}

export const getHistoryList = (params?: any) => {
  return postAjax('bus/dataSearch/historyList', params);
}


export const getApprovalList = (params?: any) => {
  return postAjax('bus/dataSearch/approvalList', params);
}
export const getRecycleList = (params?: any) => {
  return postAjax('bus/dataSearch/recycleList',params);
}


export const getDataList = (params?: any) => {
  return postAjax('bus/dataSearch/list', params);
}

export const prepareIds = (params?: any) => {
  return postAjax('/bus/dataSearch/prepareIds', params);
}


export const baiduSearch = (params?: any) => {
  return postAjax('bus/dataSearch/baiduSearch', params);
}

export const baiduDetail = (params?: any) => {
  return postAjax('bus/dataSearch/baiduDetail', params);
}

export const findAddress = (params?: any) => {
  return postAjax('bus/dataSearch/findAddress', params);
}

export const findData = (params?: any) => {
  return postAjax('bus/dataSearch/findData', params);
}




